package com.guapi.service.impl;

import com.guapi.entity.Discuss;
import com.guapi.repository.DiscussRepository;
import com.guapi.service.DiscussService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DiscussServiceImpl extends CacheServiceImpl<Discuss> implements DiscussService {
    @Autowired
    private MongoTemplate mongoTemplate;
    @Autowired
    private DiscussRepository discussRepository;

    @Override
    public List<Discuss> getAllDiscuss() {
        return discussRepository.findAll();
    }

    @Override
    public void insert(Discuss discuss) {
        discussRepository.save(discuss);
    }

    @Override
    public void delById(String id) {
        discussRepository.deleteById(id);
    }

    //@Override
    //public int updateDiscuss(Discuss discuss) {
    //    discussRepository.
    //}
}
